I have been trying to develop my own version of ucommerce demo where I have created a catalog, bound it to a host name, able to create pages where i can successfully pull and present categories, category products and product description pages. But when i try to add product to basket then i can get following error:
[The catalog 'dymo' does not exist.]
[No basket exist for the current user.]
I am using AddToBasket[XSLT].xslt which comes as part of demo uCommerce store to add product to basket. The site running running umbraco 4.5 on IIS7. I already tired the following solutions which i found on this forum but nothing seems to make a difference:
uCommerce determines which catalog group (store) and catalog it is currently by looking at the query string, e.g. www.mystore.com/shop.aspx?catalog=MyCatalog. If you make sure to carry the catalog=MyCatalog around in the URLS (like the demo store does) you should be fine.
As you've found out you can override this by setting SiteContext.Current.CatalogContext.CurrentCatalogName = "MyCatalog"; For that to work you need to set it as the first thing on your page before any calls are made to other APIs.
Alternative you can make sure that the customer basket is generated from a page that has the catalog information available by calling CommerceLibrary:GetBasket() on the page and then the AddToBasket and a subsequent page.
Even though the method CommerceLibrary:AddToBasket() takes in catalog name as parameter, I still need to make sure that the ?catalog=MyCatalog querystring is present. Am I understanding it right?
I am hard coding the catalog name when calling CommerceLibrary:AddToBasket() method but still does not work unless ucommerce need catalog info as query parameter. Is this true?
You'll have to have the catalog name be part of the URL, yes, or you can override the catalog by setting a new catalog name on the context. One thing of interest is that the catalog needs to be part of the store configured for the root URL you're using.
Say you have
SiteA.com
- MyFirstCatalog
- MySecondCatalog
SiteB.com
- MyThirdCatalog
If you're on SiteA.com you can't actually set MyThirdCatalog as that will give you the error you describe. Only MyFirstCatalog and MySecondCatalog are valid for SiteA. The reason for this is security between stores so you don't get your catalogs mixed.
Finally I was able to find out the issue which was causing the catalog I was refering to not found.
When I installed ucommerce it created ucommerce.dk catalog. Then I created my new catalog group. And then I mapped the host name to my new catalog group which was previously mapped to ucommerce.dk catalog group. So there were two catalog groups mapped to same host which was causing catalog not found because it was looking at the first catalog group which was ucommerce.dk
Add to Basket: [catalog does not exists]
I have been trying to develop my own version of ucommerce demo where I have created a catalog, bound it to a host name, able to create pages where i can successfully pull and present categories, category products and product description pages. But when i try to add product to basket then i can get following error:
[The catalog 'dymo' does not exist.] [No basket exist for the current user.]
I am using AddToBasket[XSLT].xslt which comes as part of demo uCommerce store to add product to basket. The site running running umbraco 4.5 on IIS7. I already tired the following solutions which i found on this forum but nothing seems to make a difference:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
I checked very thoroughly the host name binding with the catalog plus also tried the following from usercontrol but i got the same error:
I am able browse the catalog it just fails when try to add to basket.
Let me know what else can I try to get this thing working. Thanks
Hi Mustafa,
Are you getting any additional information in umbracoLog?
Also which version of uCommerce are you running?
Hi there: Sory for replying so late as i was expecting an email notification but i did not get one. Even though I subsribed to notifications.
I checked the umbraco logs just after trying to add a product into the basket but do not see any activity. Do I need to enable debugging? How?
I am running 1.0.4.2
Thanks
Mustufa
Hi Mustafa,
uCommerce determines which catalog group (store) and catalog it is currently by looking at the query string, e.g. www.mystore.com/shop.aspx?catalog=MyCatalog. If you make sure to carry the catalog=MyCatalog around in the URLS (like the demo store does) you should be fine.
As you've found out you can override this by setting SiteContext.Current.CatalogContext.CurrentCatalogName = "MyCatalog"; For that to work you need to set it as the first thing on your page before any calls are made to other APIs.
Alternative you can make sure that the customer basket is generated from a page that has the catalog information available by calling CommerceLibrary:GetBasket() on the page and then the AddToBasket and a subsequent page.
Hi Soren
Even though the method CommerceLibrary:AddToBasket() takes in catalog name as parameter, I still need to make sure that the ?catalog=MyCatalog querystring is present. Am I understanding it right?
Thanks
Mustufa
Hi Soren
I am hard coding the catalog name when calling CommerceLibrary:AddToBasket() method but still does not work unless ucommerce need catalog info as query parameter. Is this true?
Thanks
Mustufa
You'll have to have the catalog name be part of the URL, yes, or you can override the catalog by setting a new catalog name on the context. One thing of interest is that the catalog needs to be part of the store configured for the root URL you're using.
Say you have
SiteA.com
- MyFirstCatalog
- MySecondCatalog
SiteB.com
- MyThirdCatalog
If you're on SiteA.com you can't actually set MyThirdCatalog as that will give you the error you describe. Only MyFirstCatalog and MySecondCatalog are valid for SiteA. The reason for this is security between stores so you don't get your catalogs mixed.
Hope this helps.
Hi Soren
Finally I was able to find out the issue which was causing the catalog I was refering to not found.
When I installed ucommerce it created ucommerce.dk catalog. Then I created my new catalog group. And then I mapped the host name to my new catalog group which was previously mapped to ucommerce.dk catalog group. So there were two catalog groups mapped to same host which was causing catalog not found because it was looking at the first catalog group which was ucommerce.dk
Thanks for the help all the way.
Hi Mustafa,
Glad to hear. Sorry I couldn't be of more help. Could you mark the topic as resolved please? Thanks.
is working on a reply...